package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.reporting.entity.CmInteCoLonRepayDtl;
import com.jrx.anytxn.reporting.mapper.base.CmInteCoLonRepayDtlMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.batch.item.ItemWriter;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ModifyLonInfoWriter implements ItemWriter<CmInteCoLonRepayDtl> {

    @Resource
    private CmInteCoLonRepayDtlMapper cmInteCoLonRepayDtlMapper;

    @Override
    public void write(List<? extends CmInteCoLonRepayDtl> items) {
        if (CollectionUtils.isNotEmpty(items)) {
            for (CmInteCoLonRepayDtl m : items) {
                cmInteCoLonRepayDtlMapper.insertSelective(m);
            }
        }
    }
}
